import request from '@/utils/request'
// 根据作品id查询章节
export const getChapterApi = (id) => request.get(`/chapter/${id}`)
//保存章节 状态为0

export const insertChapterApi = ({ novelId, chapterName, chapterText }) =>
  request.post(`/chapter`, { novelId, chapterName, chapterText })
// 发布章节
export const publishChapterApi = ({ novelId, chapterName, chapterText }) =>
  request.post(`/chapter/publish`, { novelId, chapterName, chapterText })
// 根据小说id和章节id查询章节
export const getChapterDetailApi = (novelId, chapterId) =>
  request.get(`/chapter/${novelId}/${chapterId}`)

//删除章节
export const deleteChapterApi = (id) => request.delete(`/chapter/${id}`)
